package com.etc.RCCPA001;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.etc.common.Code;
import com.etc.common.CodeMessage;
import com.etc.common.SessionCode;

/**
 * 
 * Filename:    RCCPA001Controller.java  
 * Description: 后台登录，访问用户中心  
 * Copyright:   Copyright (c) 2018-2019 All Rights Reserved.
 * Company:     chinasofti.com Inc.
 * @author:     mazheng 
 * @version:    1.0  
 * Create at:   2020年3月5日 上午9:49:09  
 *  
 * Modification History:  
 * Date         Author      Version     Description  
 * ------------------------------------------------------------------  
 * 2020年3月5日      mazheng      1.0         1.0 Version  
 *
 */
@SuppressWarnings("unchecked")
@RestController
public class RCCPA001Controller {

  
    @Autowired
    RCCPA001Service servcie;
    /**
     * 登录请求
     * @param user
     * @return
     */
    @RequestMapping("admin/login.action")
    public ResponseEntity<String> login(@RequestBody RCCPA001Vo user) {
        return servcie.login(user);
    }
    
    /**
     * 注销请求
     * @return
     */
    @RequestMapping("admin/logout.action")
    public CodeMessage logout(HttpSession session) {
        session.removeAttribute(SessionCode.ADMINUSER);
        return CodeMessage.success(Code.SUCESS, "注销成功", null);
    }
}
